package com.tenebrous.jestic.service.framwork.meber.organ;

import com.tenebrous.jestic.entity.framwork.meber.organ.*;
import com.tenebrous.jestic.mapper.idao.framwork.meber.organ.*;
import com.tenebrous.jestic.entity.framwork.meber.organ.*;
import com.tenebrous.jestic.mapper.idao.framwork.meber.organ.*;
import com.tenebrous.jestic.service.SuperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrgUserExtService extends SuperService<OrgUser> {

    @Autowired
    private OrgUserEducateMapper educateMapper;

    @Autowired
    private OrgUserWorkMapper workMapper;

    @Autowired
    private OrgUserAwardMapper awardMapper;

    @Autowired
    private OrgUserTrainMapper trainMapper;

    @Autowired
    private OrgUserCertiMapper certiMapper;

    @Autowired
    private OrgUserFamilyMapper familyMapper;

    @Autowired
    private OrgUserPresentMapper presentMapper;

    @Autowired
    private OrgUserExameMapper exameMapper;

    @Autowired
    private OrgUserLanguageMapper languageMapper;

    @Autowired
    private OrgUserAchievmentMapper achievmentMapper;

    @Autowired
    private OrgUserTectitleMapper tectitleMapper;

    @Override
    protected void setSuperMapper() {
    }

    public List<OrgUserAward> queryAwardList(String userid) {
        return this.queryAwardList(userid, null, null);
    }

    public List<OrgUserAward> queryAwardList(String userid, Integer toresume) {
        return this.queryAwardList(userid, toresume, null);
    }

    public List<OrgUserAward> queryAwardList(String userid, Integer toresume, Integer tomoval) {
        return this.awardMapper.selectByCondition(userid, toresume, tomoval);
    }

    public List<OrgUserTrain> queryTrainList(String userid) {
        return this.queryTrainList(userid, null, null);
    }

    public List<OrgUserTrain> queryTrainList(String userid, Integer toresume) {
        return this.queryTrainList(userid, toresume, null);
    }

    public List<OrgUserTrain> queryTrainList(String userid, Integer toresume, Integer tomoval) {
        return this.trainMapper.selectByCondition(userid, toresume, tomoval);
    }

    public List<OrgUserEducate> queryEducateList(String userid) {
        return this.queryEducateList(userid, null, null);
    }

    public List<OrgUserEducate> queryEducateList(String userid, Integer toresume) {
        return this.queryEducateList(userid, toresume, null);
    }

    public List<OrgUserEducate> queryEducateList(String userid, Integer toresume, Integer tomoval) {
        List<OrgUserEducate> list = this.educateMapper.selectByCondition(userid, toresume, tomoval);
//        for (OrgUserEducate item : list ) {
//            String edufids = item.getEdutionFids();
//            if(StringUtils.isNotBlank(edufids)) {
//                ApiResult ar = storeClient.queryByIds(edufids.split(","));
//                item.setEdutionStolist((List<StoDto>) ar.getResult());
//            }
//            String degfids = item.getDegreeFids();
//            if(StringUtils.isNotBlank(degfids)) {
//                ApiResult ar = storeClient.queryByIds(degfids.split(","));
//                item.setDegreeStolist((List<StoDto>) ar.getResult());
//            }
//        }
        return list;
    }

    public List<OrgUserWork> queryWorkList(String userid) {
        return this.queryWorkList(userid, null, null);
    }

    public List<OrgUserWork> queryWorkList(String userid, Integer toresume) {
        return this.queryWorkList(userid, toresume, null);
    }

    public List<OrgUserWork> queryWorkList(String userid, Integer toresume, Integer tomoval) {
        List<OrgUserWork> list = this.workMapper.selectByCondition(userid, toresume, tomoval);
//        for (OrgUserWork item : list ) {
//            String fids = item.getSocialFids();
//            if(StringUtils.isNotBlank(fids)) {
//                ApiResult ar = storeClient.queryByIds(fids.split(","));
//                item.setSocialStolist((List<StoDto>) ar.getResult());
//            }
//        }
        return list;
    }

    public List<OrgUserFamily> queryFamilyList(String userid) {
        return this.queryFamilyList(userid, null, null);
    }

    public List<OrgUserFamily> queryFamilyList(String userid, Integer toresume) {
        return this.queryFamilyList(userid, toresume, null);
    }

    public List<OrgUserFamily> queryFamilyList(String userid, Integer toresume, Integer tomoval) {
        return this.familyMapper.selectByCondition(userid, toresume, tomoval);
    }

    public List<OrgUserCerti> queryCertiList(String userid) {
        return this.queryCertiList(userid, null, null);
    }

    public List<OrgUserCerti> queryCertiList(String userid, Integer toresume) {
        return this.queryCertiList(userid, toresume, null);
    }

    public List<OrgUserCerti> queryCertiList(String userid, Integer toresume, Integer tomoval) {
        List<OrgUserCerti> list = this.certiMapper.selectByCondition(userid, toresume, tomoval);
//        for (OrgUserCerti item : list ) {
//            String ctfids = item.getCtFids();
//            if(StringUtils.isNotBlank(ctfids)) {
//                ApiResult ar = storeClient.queryByIds(ctfids.split(","));
//                item.setCtStolist((List<StoDto>) ar.getResult());
//            }
//        }
        return list;
    }

    public List<OrgUserTectitle> queryTectitleList(String userid) {
        return this.queryTectitleList(userid, null, null);
    }

    public List<OrgUserTectitle> queryTectitleList(String userid, Integer toresume) {
        return this.queryTectitleList(userid, toresume, null);
    }

    public List<OrgUserTectitle> queryTectitleList(String userid, Integer toresume, Integer tomoval) {
        return this.tectitleMapper.selectByCondition(userid, toresume, tomoval);
    }

    public List<OrgUserPresent> queryPresentList(String userid) {
        return this.queryPresentList(userid, null, null);
    }

    public List<OrgUserPresent> queryPresentList(String userid, Integer toresume) {
        return this.queryPresentList(userid, toresume, null);
    }

    public List<OrgUserPresent> queryPresentList(String userid, Integer toresume, Integer tomoval) {
        return this.presentMapper.selectByCondition(userid, toresume, tomoval);
    }

    public List<OrgUserExame> queryExameList(String userid) {
        return this.queryExameList(userid, null, null);
    }

    public List<OrgUserExame> queryExameList(String userid, Integer toresume) {
        return this.queryExameList(userid, toresume, null);
    }

    public List<OrgUserExame> queryExameList(String userid, Integer toresume, Integer tomoval) {
        return this.exameMapper.selectByCondition(userid, toresume, tomoval);
    }

    public List<OrgUserLanguage> queryLanguageList(String userid) {
        return this.queryLanguageList(userid, null, null);
    }

    public List<OrgUserLanguage> queryLanguageList(String userid, Integer toresume) {
        return this.queryLanguageList(userid, toresume, null);
    }

    public List<OrgUserLanguage> queryLanguageList(String userid, Integer toresume, Integer tomoval) {
        return this.languageMapper.selectByCondition(userid, toresume, tomoval);
    }

    public List<OrgUserAchievment> queryAchievmentList(String userid) {
        return this.queryAchievmentList(userid, null, null);
    }

    public List<OrgUserAchievment> queryAchievmentList(String userid, Integer toresume) {
        return this.queryAchievmentList(userid, toresume, null);
    }

    public List<OrgUserAchievment> queryAchievmentList(String userid, Integer toresume, Integer tomoval) {
        return this.achievmentMapper.selectByCondition(userid, toresume, tomoval);
    }
}
